<?php

namespace Home\Controller;

/**
 * Description of DealerManagePageController.class控制器实例
 *
 * @author zhangzhen
 * @date 2017-01-03
 */
class DealerManagePageController extends DealerParentController {

    protected function _initialize() {
    	parent::_initialize();
        $this->validateUtil = new \Org\Util\Validate();
    }

    public function index() {
    	$dealerId = getDealerId();
    	$dealerLoginModel = D('DealerLogin');
    	$dealerLogin = D('DealerLogin')->getInfo($dealerId);
    	$currentPage = I('get.p');
    	if(empty($currentPage) || $currentPage == 1){
    		$hotelApplyModel = D('HotelApply');
    		$hotelApply = $hotelApplyModel->getInfoByDealerId($dealerId);
    		$this->assign('hotelApply',$hotelApply);
    	}
    	$dealerAdminLogic = A('Common/DealerAdmin', 'Logic');
    	$dealerAdminLogic->getHotel($dealerId);

        //获取区号时区数据
        $HotelLogic = A('Common/Hotel', 'Logic');
        $universalTimeData = $HotelLogic->universalTimeList();
        $this->assign('universalTimeList', $universalTimeData);

        // 获取系统货币
        $currencyLogic = A('Common/Currency', 'Logic');
        $currencyData = $currencyLogic->getBpCurrency();
        $this->assign('currencyInfo', $currencyData);
    	
    	$this->assign('enddate',$dealerLogin['enddate']);
        $this->display();
    }
}
